<?php
/* @var $this PageController */
/* @var $model Page */


$panjangMax = 5;
?>
<?php $this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'page1-grid',
    'dataProvider' => $arrayDataProvider,
//    'filter'=>$model,
	'columns'=>array(
//        'halaman_id',
//        'top_halaman',
        array(
            'header' => 'Nama Halaman',
            'name' => 'nama_halaman',
            'type' => 'raw',
//            'value' => 'CHtml::encode($data["nama_halaman"])'
            'value' => 'l(e($data["nama_halaman"]),url("page/update",array("id"=>$data["halaman_id"])))'
        ),
        array(
            'header' => 'Kategori',
            'name' => 'kategori_halaman',
            'type' => 'raw',
            'value' => '$data["kategori_halaman"] == 0 ? "Non Aplikasi" : "Aplikasi"'
        ),
//        'nama_halaman',
//        array(
//            'header'=>'Ordering',
//            'name' => 'urut_halaman',
//            'type' => 'raw',
//            'value' => 'l("Up",url("/backend/cnihalaman/up"))'
//        ),
        array
        (
            'header' => 'Urutan',
            'class' => 'CButtonColumn',
            'template' => '{up}{down}',
            'buttons' => array
            (
                'up' => array
                (
                    'label' => 'Up',
                    'imageUrl' => bu() . '/img/admin/up.gif',
                    'url' => 'url("page/up",array("id"=>$data["halaman_id"]))',
                    'visible' => '!$data["first"]',
                ),
                'down' => array
                (
                    'label' => 'Down',
                    'imageUrl' => bu() . '/img/admin/down.gif',
                    'url' => 'url("page/down",array("id"=>$data["halaman_id"]))',
                    'visible' => '!$data["last"]',
                ),
            ),
        ),
        array
        (
            'header' => 'Delete',
            'class' => 'CButtonColumn',
            'template' => '{delete}',
            'buttons' => array(
                'delete' => array(
                    'url' => 'url("page/delete",array("id"=>$data["halaman_id"]))',
                    'imageUrl' => bu() . '/img/admin/trash.gif',
                )
            ),
            'deleteConfirmation'=>Yii::t('ui','Apakah anda yakin menghapus menu ini?
Karena otomatis menghapus submenu.'),
        ),
//        'isi_halaman',
//        'gol_halaman',
		/*
		'kategori_halaman',
		'status_halaman',
		'tgl_halaman',
		'ip_halaman',
		'url',
		*/
	),
)); ?>
